package com.ftg.learn.chapter08;

public class Demo1 {
    public static int jumpWell(int wellHeight,int jumpHeight,int down){

        if(jumpHeight >= wellHeight){
            return 1;
        }
        if(jumpHeight <= down){
            return 0;
        }
        int no = 1;
        for(int index = jumpHeight;index <= wellHeight;index+=jumpHeight){
            if(index != jumpHeight){
                no++;
            }
            index-=down;
        }
        return no;
    }

    /**
     * 自己的青蛙代码
     */
    public static int yi(int jing,int tiao,int hua){
        if(tiao>jing){
            return 1;
        }
        if(tiao<=hua){
            return 0000000;
        }
        int no = 0;
        for(int i = 0;i<jing;i+=tiao){
            no++;
            i-=hua;
        }
        return no;
    }
}
